package com.meiyou.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.meiyou.pojo.vo.GuideVo;
import com.meiyou.pojo.vo.TourApplyVo;
import com.meiyou.pojo.vo.TuinaApplyVo;
import com.meiyou.pojo.vo.YuehuiApplyVo;
import com.meiyou.service.GuideService;
import com.meiyou.service.TourService;
import com.meiyou.service.TuiNaService;
import com.meiyou.service.YueHuiService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Controller
@Api(value = "美游app控制器", tags = { "所有api接口" })
public class MyApplyController {
	@Resource
	private TourService tourServiceImpl;
	@Resource
	private YueHuiService yueHuiServiceImpl;
	@Resource
	private TuiNaService tuiNaServiceImpl;
	@Resource
	private GuideService guideServiceImpl;
	
	@RequestMapping(value = "MyApply", method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation(value = "我的报名")
	public Map<String, Object> MyApply(HttpServletRequest request){
		String uCount=request.getSession().getAttribute("user")+"";
		Map<String, Object> map = new HashMap<String, Object>();
		List<YuehuiApplyVo> yuehui = yueHuiServiceImpl.selMyYhApply(uCount);
		List<TourApplyVo> tour = tourServiceImpl.selMyTourApply(uCount);
		List<TuinaApplyVo> tuina = tuiNaServiceImpl.selMyTnApply(uCount);
		List<GuideVo> guide = guideServiceImpl.selMyGuideApply(uCount);
		map.put("yuehui", yuehui);
		map.put("tour", tour);
		map.put("tuina", tuina);
		map.put("guide", guide);
		return map;
	}
}
